home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_sophiaroom_door.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  113 lines

  1. # Jones 3D Cog Script
  2. #
  3. # Vol_SophiaRoom_door.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message    startup        
  14.     message    crossed    
  15.     message    blocked        
  16.  
  17.     thing        door0        linkid=0
  18.     surface        adjoin0         linkid=1        mask=0x405
  19.     surface        adjoin1         linkid=2        mask=0x405
  20.  
  21.  
  22.     float    doorspeed=4.0
  23.     float    sleepTime=2.0
  24.     
  25.     int        open=0    local
  26.     int        checked=0    local
  27.     
  28.     sector    doorSector            local
  29.  
  30.     sound    locked1=INXJ081.WAV        local
  31.     sound    locked2=INXJ076.WAV        local
  32.     sound    locked3=INXJ077.WAV        local
  33.  
  34.     vector    campos                    local
  35.     thing    player                    local
  36.     int        curCam                    local
  37.  
  38. end
  39.  
  40. # ========================================================================================
  41.  
  42. code
  43.  
  44. startup:
  45.     doorSector = GetThingSector(door0);
  46.     SetSectorAdjoins(doorSector, 0);
  47.     return;
  48.  
  49. # ........................................................................................
  50.  
  51. crossed:
  52.  
  53.         if (getSenderID() == 1)
  54.         {
  55.         if (open == 1) return;
  56.         if (IsThingMoving(door0)) return;
  57.             
  58.         {
  59.                 open = 1;
  60.                 SetSectorAdjoins(doorSector, 1);
  61.                 Rotate(door0, 90, 1, doorspeed);
  62.                 waitforstop(door0);
  63.                 sleep(sleeptime);
  64.                 Rotate(door0, -90, 1, doorspeed);
  65.                 waitforstop(door0);
  66.                 SetSectorAdjoins(doorSector, 0);
  67.                 open = 0;
  68.                 return;
  69.             }
  70.         }
  71.     else
  72.         
  73.         if (GetSenderID() == 2)
  74.         {
  75.                 
  76.                 if (open == 1) return;
  77.                 if (IsThingMoving(door0)) return;
  78.                 
  79.             {
  80.                 If (checked == 0)
  81.                 {
  82.                 curCam = GetCurrentCamera();
  83.                 # Disable and hide player
  84.                 SetThingFlags(player, 0x80000);
  85.                       
  86.                 # Cut to cutscene camera
  87.                 camPos = VectorSet(-0.15, 0.0, 0.065);
  88.                 SetExtCamOffset(camPos);
  89.                 SetThingFlags(player, 0x200000);
  90.                 PlayVoice(player, locked1, 1.0, 1);
  91.                 RestoreExtCam();
  92.                 checked = 1;
  93.                 return;
  94.                 }
  95.                 else If (checked == 1)
  96.                 {
  97.                     PlayVoice(player, locked3, 1.0, 1);
  98.                     return;
  99.                 }
  100.             }
  101.         }
  102.         
  103. # ........................................................................................
  104.  
  105. blocked:
  106.     rotatepivot(door0, 1, doorspeed);
  107.     return;
  108.  
  109. # ........................................................................................
  110.  
  111. end
  112.  
  113.